import React from 'react';

function isComponentClass(component: unknown) {
  if (!component) return false;
  const proto = Object.getPrototypeOf(component);
  if (proto === React.Component || proto === Function.prototype) return true;
  return isComponentClass(proto);
}

export default isComponentClass;
